package models

import (
	"go-project/common"
)

type User struct {
	ID        uint              `gorm:"primary_key" json:"id"`
	CreatedAt *common.LocalTime `json:"created_at"`
	UpdatedAt *common.LocalTime `json:"updated_at"`
	DeletedAt *common.LocalTime `sql:"index" json:"deleted_at"`
	Mobile    string            `gorm:"type:varchar(20);not null;default:'';comment:'手机号'"`
	Password  string            `gorm:"type:varchar(200);not null;comment:'密码'"`
	Email     string            `gorm:"type:varchar(100);not null;default:'';comment:'邮箱'"`
	Username  string            `gorm:"not null;default:'';unique_index;comment:'用户名'" json:"username"`
}

func (user *User) TableName() string {
	return "users"
}
